package com.zelin.page.controller;

import com.zelin.page.client.OrderClient;
import com.zelin.page.service.PageService;
import com.zyg.common.entity.TbPayLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ------------------------------
 * 功能：
 * 作者：WF
 * 微信：hbxfwf13590332912
 * 创建时间：2021/11/4-15:33
 * ------------------------------
 */
@RestController
@RequestMapping
public class PageController {
    @Autowired
    private PageService pageService;
    @Autowired
    private OrderClient orderClient;
    //1. 根据spu的商品id,生成静态页面
    @GetMapping("page/createHtml")
    public void createHtml(Long id){
        System.out.println("id = " + id);
        //1.1 生成静态的html并放到本机的nginx中
        pageService.createHtml(id);

    }

    @RequestMapping("page/findPayPlog/{id}")
    TbPayLog findPayLog(@PathVariable("id") String id){
        return orderClient.findPayLog(id);
    }
}
